# All configuration for plugins and other utils is defined here.
# Read more about `setup.cfg`:
# https://docs.python.org/3/distutils/configfile.html

[flake8]
format = wemake
show-source = True
statistics = True
doctests = True
enable-extensions = G
no-accept-encodings = True

# Flake plugins
max-line-length = 80
max-complexity = 6
radon-max-cc = 10
radon-show-closures = True
radon-no-assert = True
inline-quotes = double
allowed-domain-names = handle

# Excluding some directories:
exclude = .git,
          __pycache__,
          .venv,

ignore = D100 D104 D106 D401 X100 W503 WPS306 WPS317 WPS121 DJ12 WPS348

per-file-ignores =
  src/settings/*.py: WPS226 WPS407 WPS412 WPS432
  src/*/migrations/*.py: WPS102 WPS432 E501 DJ01 WPS318 WPS319 C101 WPS458 WPS226 WPS118
  WPS114, WPS301, D101 D103 Q000 WPS221 I001 I003 WPS219
  src/__init__.py: WPS412
  src/*/**/__init__.py: F401 WPS300 WPS412 I001 WPS412 WPS410
  src/apps/*/models/enums/**.py: WPS115 WPS412 WPS300 F401
  tests/*.py: S101 WPS432 WPS226 WPS442 S106 WPS204 S105
  tests/*/**/__init__.py: WPS412 F401 WPS300 WPS410


[tool:pytest]
# Django configuration:
# https://pytest-django.readthedocs.io/en/latest/
DJANGO_SETTINGS_MODULE = src.settings
django_find_project = false
pythonpath = . src

# Directories that are not visited by pytest collector:
norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__

# You will need to measure your tests speed with `-n auto` and without it,
# so you can see whether it gives you any performance gain, or just gives
# you an overhead.
addopts =
  --strict-markers
  --tb=short
  --fail-on-template-vars
  --reuse-db
  --nomigrations
  --durations=15
  --maxfail=20
  --cov=src
  --cov=tests
  --cov-branch
  --cov-report=
  --cov-fail-under=80

;filterwarnings =
;  error

[coverage:run]
omit = src/*/migrations/*

[isort]
# isort configuration:
# https://github.com/timothycrosley/isort/wiki/isort-Settings
include_trailing_comma = true
# See https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
# Should be: 80 - 1
line_length = 79
skip = __init__.py, migrations
force_grid_wrap = 0
use_parentheses = True
src_paths = src,tests

[darglint]
# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long

[mypy]
python_version = 3.10

allow_redefinition = False
check_untyped_defs = True
;disallow_any_explicit = True
disallow_any_generics = True
disallow_untyped_calls = True
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
strict_equality = True
no_implicit_optional = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
warn_no_return = True

[mypy-src.*.migrations.*]
ignore_errors = True

[mypy-src.apps.*.models]
# FIXME: remove this line, when `django-stubs` will stop
# using `Any` inside.
disallow_any_explicit = False


[doc8]
ignore-path = docs/_build
max-line-length = 80
sphinx = True
